/*
 * MIT License
 * 
 * Copyright (c) 2017 wen.gu <454727014@qq.com>
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/***************************************************************************
 * Name: vos_sys.h
 *
 * Purpose: virtual os layer the interface about system define
 *
 * Developer:
 *   wen.gu , 2017-03-20
 *
 * TODO: 
 *
 ***************************************************************************/

#ifndef __VOS_SYS_H__
#define __VOS_SYS_H__

#include <stdarg.h>

#include "general_type.h"



#ifdef __cplusplus
extern "C"{
#endif
/***************************************************************************
 *
 * vos macro declaration
 *
 ***************************************************************************/

/***************************************************************************
 *
 * vos struct declaration
 *
 ***************************************************************************/
typedef struct vosDate_s
{ 
    GS32 year; 
    GS32 mon; 
    GS32 day; 
    GS32 hour; 
    GS32 min; 
    GS32 sec; 
}vosDate_t;
/***************************************************************************
 *
 * VOS Sleep API declaration
 *
 ***************************************************************************/
/**
*@brief  do sleep unit in millisecond
*
*@param  ms [in] sleep time count
*
*@return None.
*@see 
*/
G_API void vosSleepMs(GU32 ms);

/**
*@brief  do sleep unit in second
*
*@param  sec [in] sleep time count
*
*@return None.
*@see 
*/
G_API void vosSleepSec(GU32 sec);


/***************************************************************************
 *
 * vos Dynamic library(or share library) API declaration
 *
 ***************************************************************************/
/**
*@brief  load a Dynamic library(or share library)
*
*@param  dllname [in]  dynamic library path and name
*
*@return if success return dl handle,else return 'NULL'.
*@see 
*/
G_API GPHD vosLoadDLL(const GS08 *dllname);

/**
*@brief  free a Dynamic library(or share library) handle.
*
*@param  dllHd  [in]  dynamic library handle
*
*@return None.
*@see 
*/
G_API void vosFreeDLL(GPHD dllHd);

/**
*@brief  get a symbole from Dynamic library(or share library)
*
*@param  dllHd  [in]  dynamic library handle
*@param  symbol [in]  symbol name
*
*@return if success return symbol pointer,else return 'NULL'.
*@see 
*/
G_API void *vosGetDLLSymbol(GPHD dllHd, const GS08 *symbol);

/***************************************************************************
 *
 * VOS System Time API declaration
 *
 ***************************************************************************/

/**
*@brief  get current time unit in microsecond(us)
*
*@param  None.
*
*@return current time unit in microsecond(us)
*@see 
*/
G_API GS64 vosSysTimeUs(void);

/**
*@brief  get current time unit in millisecond
*
*@param  None.
*
*@return current time unit in millisecond
*@see 
*/
G_API GS64 vosSysTimeMs(void);

/**
*@brief  get current date and time
*
*@param  dt [out]  return current data and time
*
*@return None.
*@see 
*/
G_API void vosSysDateTime(vosDate_t *dt);

#ifdef __cplusplus
}
#endif

#endif //end of __VOS_SYS_H__
